package com.sk.bilibili.view.fragment.search;

import androidx.viewbinding.ViewBinding;

import com.sk.bilibili.adapter.pager.search.SearchFragmentAdapter;
import com.sk.bilibili.adapter.vlayout.BaseCollectionAdapter;
import com.sk.bilibili.adapter.vlayout.search.MemberAdapter;
import com.sk.bilibili.bean.Focus;
import com.sk.bilibili.bean.Member;
import com.sk.bilibili.callBack.MemberClickCallBack;
import com.sk.bilibili.model.fragment.search.MemberModel;
import com.sk.bilibili.view.activity.MemberActivity;

public class MemberFragment extends BaseSearchFragment<MemberModel, Member> implements MemberClickCallBack {


    public MemberFragment(SearchFragmentAdapter parent, int pos) {
        super(parent, pos);
    }

    @Override
    protected BaseCollectionAdapter<? extends ViewBinding, Member> getAdapter() {
        return new MemberAdapter(getContext(),this);
    }

    @Override
    public void onMemberClick(Integer memberId) {
        MemberActivity.start(getContext(),memberId);
    }

    @Override
    public void onFocusClick(Integer focusId) {
        model.switchFocus(focusId);
    }

    public void switchFocusSuccess(Focus focus) {
        toast(focus==null?"取消关注成功":"关注成功");
    }

}